package com.pro.mapper;

import com.pro.pojo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

public interface JsUserCouponMapper {

    /**
     *
     * @author MYH - SiYun
     * @date 2022/1/9 20:29
     * 查询优惠券列表
     */
    public List<JsUserCoupon> getJsUserCouponList(JsUserCoupon jsUserCoupon);

    /**
     *
     * @author MYH - SiYun
     * @date 2022/1/10 11:43
     * 优惠券高级检索
     */
    public List<JsUserCoupon> getJsUserCouponRetrieval(JsUserCoupon jsUserCoupon);

    /**
     *
     * @author MYH - SiYun
     * @date 2022/1/10 11:52
     * 修改优惠券上线与下线状态
     */
    public boolean updateJsUserCouponOnline(JsUserCoupon jsUserCoupon);

    /**
     *
     * @author MYH - SiYun
     * @date 2022/1/10 13:38
     * 删除优惠券
     */
    public boolean deleteJsUserCoupon(Integer couponId);

    /**
     *
     * @author MYH - SiYun
     * @date 2022/1/10 14:54
     * 查看用户优惠券
     */
    List<JsBeforeUser> getJsUserCoupon(JsBeforeUser jsBeforeUser);

    /**
     *
     * @author MYH - SiYun
     * @date 2022/1/10 15:55
     * 根据用户id查看用户已使用、未使用优惠券
     */
    public Integer getJsUserCouponState(@Param("usedState")Integer usedState,@Param("userId")Integer userId);

    /**
     *
     * @author MYH - SiYun
     * @date 2022/1/10 18:47
     * 查询用户个人过期优惠券
     */
    public List<String> getJsUserCouponEnd(Integer userId);

    /**
     *
     * @author MYH - SiYun
     * @date 2022/1/10 19:15
     * 给用户赠送优惠券后添加优惠券使用记录
     */
    public boolean addJsUserCouponUsed(JsUserCouponUsed jsUserCouponUsed);

    /**
     *
     * @author MYH - SiYun
     * @date 2022/1/10 20:04
     * 给用户赠送优惠券后修改优惠券的剩余数量
     */
    public boolean updateJsUserCouponUsed(Integer couponId);

    /**
     *
     * @author MYH - SiYun
     * @date 2022/1/10 20:33
     * 查询优惠券剩余数量
     */
    public Integer getJsUserCouponSurplus(Integer couponId);

    /**
     *
     * @author MYH - SiYun
     * @date 2022/1/11 10:37
     * 添加优惠券
     */
    public boolean addJsUserCoupon(JsUserCoupon jsUserCoupon);

    /**
     *
     * @author MYH - SiYun
     * @date 2022/1/11 13:33
     * 获取所有优惠券编号
     */
    public List<Integer> getJsUserCouponCode();

    /**
     *
     * @author MYH - SiYun
     * @date 2022/1/14 8:44
     * 查看优惠券是否过期
     */
    public String getJsUserCouponEndDate(Integer couponId);

}
